/*kZime*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#define MAXN 233
using namespace std;
int n, s, a[MAXN], aa[100233], f[100233], d[100233], paf[100233], pad[100233]; 
inline int read() {
	int k = 0, f = 1; char c = getchar();
	for(; !isdigit(c); c = getchar())if(c == '-') f = -1;
	for(; isdigit(c); c = getchar()) k = k * 10 + c - '0';
	return k * f;
}
vector <int> ma, mi;
void ppf(int s) {
	if(s == 0)return;
	printf("%d ",aa[s - paf[s]]);
	ppf(paf[s]);
}
void ppd(int s) {
	if(s == 0)return;
	printf("%d ",aa[s - pad[s]]);
	ppd(pad[s]);
}
int _233() {
#ifndef LOCAL
	freopen("kouka.in", "r", stdin);
	freopen("kouka.out", "w", stdout);
#else
	freopen("in.txt", "r", stdin);
#endif
	memset(f, 0x3f / 2, sizeof(f));
	memset(d, -0x3f / 2, sizeof(d));
	n = read();
	s = read();
	for(int i = 1; i <= n; i++) {
		a[i] = read(); 
		aa[a[i]] = i;
	}
	d[0] = f[0] = 0;                  
	
	for(int i = 1; i <= s; i++) {
		for(int j = 1; j <= n; j++) {
			if(i - a[j] < 0)continue;
			else if(f[i - a[j]] + 1 < f[i]){
				f[i] = f[i - a[j]] + 1;
				paf[i] = i - a[j];
			}
		}
	}
	
	for(int i = 1; i <= s; i++) {
		for(int j = 1; j <= n; j++) {
			if(i - a[j] < 0)continue;
			else if(d[i - a[j]] + 1 > d[i]){
				d[i] = d[i - a[j]] + 1;
				pad[i] = i - a[j];
			}
		}
	}
	
//	for(int i = 1; i <= s; i++) {
//		printf("%d ",d[i]);
//	}
//	getchar();
	printf("%d %d\n",f[s], d[s]);
	
	ppf(s);
	
	printf("\n");
	
	ppd(s);

	return 0;
}
int _lky = _233();
int main(){
	;
}
